using System;
using System.Collections.Generic;
using System.Text;

namespace MomentumV2
{
    class mMainMenuScreen : mMenuScreen
    {

        #region Initialization

        public mMainMenuScreen()
            : base("Main Menu")
        {
            mMenuEntry playGameMenuEntry = new mMenuEntry("Play!");
            mMenuEntry optionsMenuEntry = new mMenuEntry("Options");
            mMenuEntry exitMenuEntry = new mMenuEntry("Exit");

            playGameMenuEntry.Selected += PlayGameMenuEntrySelected;
            optionsMenuEntry.Selected += OptionsMenuEntrySelected;
            exitMenuEntry.Selected += OnCancel;

            MenuEntries.Add(playGameMenuEntry);
            MenuEntries.Add(optionsMenuEntry);
            MenuEntries.Add(exitMenuEntry);
        }

        #endregion

        #region Handle Input

        void PlayGameMenuEntrySelected(object sender, EventArgs e)
        {
            //LoadingScreen.Load(ScreenManager, true, new GameplayScreen());
        }


        void OptionsMenuEntrySelected(object sender, EventArgs e)
        {
            ScreenManager.AddScreen(new mOptionsMenuScreen());
        }


        protected override void OnCancel()
        {
            const string message = "Are you sure you want to exit?";
            mMessageBoxScreen confirmExitMessageBox = new mMessageBoxScreen(message);
            confirmExitMessageBox.Accepted += ConfirmExitMessageBoxAccepted;
            ScreenManager.AddScreen(confirmExitMessageBox);
        }


        void ConfirmExitMessageBoxAccepted(object sender, EventArgs e)
        {
            ScreenManager.Game.Exit();
        }

        #endregion

    }
}
